using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;

namespace Microsoft.ConnectionEngine.Administration.Core.ServiceProvider.Exception
{
    public class ServiceProviderRegisterAdminException : System.Exception
    {

        private HSDAdminEntities entity;

        public HSDAdminEntities Entity
        {
            get { return entity; }
            set { entity = value; }
        }
        private HSDAdminOperations operation;

        public HSDAdminOperations Operation
        {
            get { return operation; }
            set { operation = value; }
        }

        private void Initialize(HSDAdminEntities hsdEntity, HSDAdminOperations hsdOperation)
        {
            Entity = hsdEntity;
            Operation = hsdOperation;
        }

        public ServiceProviderRegisterAdminException()
        {
            Initialize(HSDAdminEntities.None,HSDAdminOperations.None);
        }

        public ServiceProviderRegisterAdminException(string message) : base(message)
        {
            Initialize(HSDAdminEntities.None,HSDAdminOperations.None);
        }

        public ServiceProviderRegisterAdminException(string message, System.Exception inner) : base(message,inner)
        {
            Initialize(HSDAdminEntities.None,HSDAdminOperations.None);
        }

        public ServiceProviderRegisterAdminException(string message, System.Exception inner, HSDAdminEntities hsdentity, HSDAdminOperations hsdoperation) : base(message, inner)
        {
            Initialize(hsdentity,hsdoperation);
        }


        #region Serialization
		protected ServiceProviderRegisterAdminException(SerializationInfo info, StreamingContext context) : base (info, context)
        {
            Entity = (HSDAdminEntities) info.GetValue("Entity", Entity.GetType());
            Operation = (HSDAdminOperations) info.GetValue("Operation",Operation.GetType());

        }

        public override void GetObjectData (SerializationInfo info, StreamingContext context)
        {
            info.AddValue("Entity", Entity);
            info.AddValue("Operation", Operation);
            
            // call the base exception class to ensure proper serialization
            base.GetObjectData (info, context);
        } 
	    #endregion
    }
}